'use strict';

const { logger } = require('ee-core/log');
const { homeService } = require("../service/home.js");

/**
 * example
 * @class
 */
class HomeController {
    /**
     * 所有方法接收两个参数
     * @param args 前端传的参数
     * @param event - ipc通信时才有值。详情见：控制器文档
     */
    async getLoginUrl() {
        let loginUrl = await homeService.getLoginUrl();
        return loginUrl;
    }
    async openHome(args, event) {
        let url = args.url;
        const result = homeService.open(url);
        logger.info('service result:', result);

        return 'hello electron-egg';
    }
    async getTabs() {
        const tabs = homeService.getTabs();
        return tabs;
    }
}
HomeController.toString = () => '[class HomeController]';

module.exports = HomeController; 